package org.pan.domain.enums;

/**
 * 卡片类型
 *
 * * Created by panmingzhi on 2015/12/25.
 */
public enum CardTypeEnum {
	Remote, ReadOnly, ReadWrite;

	public static final String REMOTE = "远程访问卡";
	public static final String READONLY = "只读卡";
	public static final String READWRITE = "单页读写卡";

	@Override
	public String toString() {
		switch (this) {
			case Remote:
				return CardTypeEnum.REMOTE;
			case ReadOnly:
				return CardTypeEnum.READONLY;
			case ReadWrite:
				return CardTypeEnum.READWRITE;
			default:
				assert false : "Code cannot go here";
				return "";
		}
	}

	public static CardTypeEnum parse(byte cardType) {
		switch (cardType) {
		case 0x52:
			return ReadOnly;
		default:
			assert false : "Code cannot go here for value: " + cardType;
		}
		return null;
	}
}
